#! /bin/bash

hive  -S -e  "
--==========考勤主题宽表========
drop table if exists bxg_dws.dws_student_daycount;
create table if not exists bxg_dws.dws_student_daycount(

    class_id                    string     comment '班级id',
    class_date                  string     comment '上课日期',
    morning_normal_signin       bigint     comment '上午正常出勤人数',
    afternoon_normal_signin     bigint     comment '下午正常出勤人数',
    evening_normal_signin       bigint     comment '晚上正常出勤人数',
    morning_late_signin         bigint     comment '上午迟到人数',
    afternoon_late_signin       bigint     comment '下午迟到人数',
    evening_late_signin         bigint     comment '晚上迟到人数',
    morning_leave               bigint     comment '上午请假人数',
    afternoon_leave             bigint     comment '下午请假人数',
    evening_leave               bigint     comment '晚上请假人数',
    student_count               bigint     comment '班级在读总人数'

) comment '出勤主题表'
row format delimited
fields terminated by '\t'
stored as orc
tblproperties ('orc.compress'='SNAPPY');

"